<{include file=admin/header.html}>
<script type="text/javascript">
$(document).ready(function(){
	var v = $("#form").validate({
		rules:{
			title: {required:true, maxlength:50},
			cdate: {required:true, date:true}
		}
	});
});
</script>
<div id="wrapper">
	<div id="content">
		<div id="box">
			<h3><{T w='News'}></h3>
			<table width="100%">
			<thead>
			<tr>
				<th width="40px"><a href="#">ID<img src="/media/img/icons/arrow_down_mini.gif" width="16" height="16" align="absmiddle" /></a></th>
				<th><a href="#"><{T w='Title'}></a></th>
				<th><a href="#"><{T w='Date time'}></a></th>
				<th width="60px"><a href="#"><{T w='Action'}></a></th>
			</tr>
			</thead>
			<tbody>
			<{foreach item=item from=$tList}>
			<tr>
				<td class="a-center"><{$item.newsid}></td>
				<td><{$item.title}></td>
				<td><{$item.cdate}></td>
				<td  class="a-center"><a href="<{spUrl c=module a=news action=edit id=$item.newsid}>"><img src="/media/admin/img/icons/user_edit.png" title="<{T w='Edit news'}>" width="16" height="16" /></a><a onclick="if(confirm('<{T w='delete this record?'}>')){return true}else{return false};" href="<{spUrl c=module a=news action=delete id=$item.newsid}>"><img src="/media/admin/img/icons/user_delete.png" title="<{T w='Delete news'}>" width="16" height="16" /></a></td>
			</tr>
			<{foreachelse}><{/foreach}>
			</tbody>
			</table>
			<{if $tPageBar ne null}>
			<div id="pager">
				Page <a href="<{spUrl c=module a=news page=$tPageBar.prev_page size=$tPageBar.page_size}>"><img src="/media/admin/img/icons/arrow_left.gif" width="16" height="16" /></a> 
				<input size="2" value="<{$tPageBar.current_page}>" type="text" name="page" id="page" /> 
				<a href="<{spUrl c=module a=news page=$tPageBar.next_page size=$tPageBar.page_size}>"><img src="/media/admin/img/icons/arrow_right.gif" width="16" height="16" /></a>of <{$tPageBar.total_page}>
				pages | View
				<select id="size" name="size" onchange="location.href='/admin.php/module/news/page/1/size/'+$('#size').val();">
					<option <{if $tPageBar.page_size eq 10}>selected="selected"<{/if}>>10</option>
					<option <{if $tPageBar.page_size eq 20}>selected="selected"<{/if}>>20</option>
					<option <{if $tPageBar.page_size eq 50}>selected="selected"<{/if}>>50</option>
					<option <{if $tPageBar.page_size eq 100}>selected="selected"<{/if}>>100</option>
				</select>
				per page | Total <strong><{$tPageBar.total_count}></strong> records found
			</div>
			<{/if}>
		</div>
		<div id="box">
			<h3 id="adduser"><{if $action eq 'edit'}><{T w='Edit News'}><{else}><{T w='Add News'}><{/if}></h3>
			<form id="form" name="form" action="<{spUrl c=module a=news action=post}>" method="post">
			<fieldset id="newsform">
				<label for="title"><{T w='Title'}> : </label>
				<input name="title" id="title" type="text" value="<{$tDetail.title}>" /><br />
				<label for="cdate"><{T w='Publish date'}> : </label>
				<input name="cdate" id="cdate" type="text" value="<{$tDetail.cdate}>" /><br />
				<label for="content"><{T w='Content'}> : </label>
				<textarea name="content" id="content"><{$tDetail.content}></textarea><br/>
			</fieldset>
			<div align="center">
				<input type="hidden" name='id' value="<{$tDetail.newsid}>"/>
				<input type="hidden" name="type" value="<{if $action eq 'edit'}>edit<{else}>add<{/if}>" />
				<input id="button1" type="submit" value="<{T w='Submit'}>" />
				<input id="button2" type="reset" />
			</div>
			</form>
		</div>
	</div>
	<{include file=admin/sidebar.html}>
</div>
<{include file=admin/footer.html}>